<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="UTF-8" />
    <meta
      name="viewport"
      content="width=device-width,user-scalable=no,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0"
    />
    <script>
      // #ifdef H5
      // 微信环境检查并实现自动登录，默认使用静默授权
      if (/MicroMessenger/i.test(navigator.userAgent)) {
        window.withWeChatLogin = function (mode) {
          let src = encodeURIComponent(document.location.href);
          let ssi = sessionStorage.getItem("wechat.session") || "";
          let url = `%APP_HTTP%/plugin-account/api.wechat/oauth?ssid=${ssi}&mode=${mode}&source=${src}`;
          let xhr = new XMLHttpRequest();
          xhr.withCredentials = true;
          xhr.open("GET", url, false);
          xhr.onreadystatechange = function () {
            if (xhr.readyState == 4 && xhr.status == 200) {
              eval(xhr.responseText);
            }
          };
          xhr.send();
        };
        withWeChatLogin(0);
      }
      // #endif
    </script>
    <title></title>
    <!--preload-links-->
    <!--app-context-->
  </head>
  <body>
    <div id="app"><!--app-html--></div>
    <script type="module" src="/main.ts"></script>
  </body>
</html>
